<?php

header('content-type: text/csv;');
$name='test';

header('Content-Disposition: attachment; filename=Rapport_Complet_'.$name.'_'.time().'.csv');

require("../config/connexion_db.config.php");

$resultat=$connexion->query("select id,email,prenom from users");
	
$table=$resultat->fetchAll();
?>
"ID Membre";"Pseudo";"Mot de passe"
<?php
	foreach($table as $d){
		echo "\n".'"'.$d['id'].'";"'.$d['email'].'";"'.$d['prenom'].'"';
	}
?>
